//
//  HDSocialViewController.swift
//  Excited
//
//  Created by X140Yu on 6/13/16.
//  Copyright © 2016 X140Yu. All rights reserved.
//

import UIKit
import PageMenu

class HDSocialViewController: UIViewController {
    
    // MARK: - Properties
    var pageMenu: CAPSPageMenu?
    

    // MARK: ViewController life cycle
    override func viewDidLoad() {
        super.viewDidLoad()
        
        navigationController?.navigationBar.barTintColor = UIColor.redColor()
        
        var controllerArray : [UIViewController] = []
        
        let newsController = HDNewsViewController()
        newsController.title = "新闻"
        controllerArray.append(newsController)
        
        let qAndAController = HDQAndAViewController()
        qAndAController.title = "问答"
        controllerArray.append(qAndAController)
        
        let secondHandController = HDSecondHandViewController()
        secondHandController.title = "二手"
        controllerArray.append(secondHandController)
        
        let parameters: [CAPSPageMenuOption] = [
            .MenuItemSeparatorWidth(4.3),
            .UseMenuLikeSegmentedControl(true),
            .MenuItemSeparatorPercentageHeight(0.1),
            .ScrollMenuBackgroundColor(UIColor.redColor()),
            .UnselectedMenuItemLabelColor(UIColor.whiteColor()),
            .MenuItemSeparatorColor(UIColor.clearColor())
        ]
        
        pageMenu = CAPSPageMenu(viewControllers: controllerArray, frame: CGRectMake(0.0, 64, view.frame.width, view.frame.height), pageMenuOptions: parameters)
        
        view.addSubview(pageMenu!.view)
    }
    
    /*
    // MARK: - Navigation

    // In a storyboard-based application, you will often want to do a little preparation before navigation
    override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
        // Get the new view controller using segue.destinationViewController.
        // Pass the selected object to the new view controller.
    }
    */
}